Deleting Duplicates - mariaDB
This works quite fast and 14 k isn't that much data
You should add a unique constraint on UserID so that you will never have to run it again


CREATE TABLE DeviceDetails   (
  `UserID` INTEGER,
  `RegisterDate` varchar(10),
  `UniqueID` VARCHAR(6)
);

INSERT INTO DeviceDetails  
  (`UserID`, `RegisterDate`, `UniqueID`)
VALUES
  ('12345', '12-08-2020', 'ABC123'),
  ('12345', '11-05-2020', 'XYZ789'),
  ('23455', '20-08-2020', 'QWE345');




delete d from 
DeviceDetails d
inner join (
    select max(`RegisterDate`) as maxdate, `UserID` from DeviceDetails 
    group by `UserID` 
    having count(*) &gt; 1
) u on u.`UserID` = d.`UserID` and u.maxdate != d.`RegisterDate`;




SELECT * FROM DeviceDetails;


UserID | RegisterDate | UniqueID
-----: | :----------- | :-------
 12345 | 12-08-2020   | ABC123  
 23455 | 20-08-2020   | QWE345  


db&lt;&gt;fiddle here