Hi Syarbrou,
I used to managed and on-prem environment and sure you should be able to run a sql query on the DB as it is on prem, I do not not recall the actual SQL statement but yes you should be able to find the record and also delete such.
I recommend to backup the DB prior running any commands, and also to run the maintenance routing every 3 months or so depending on how many users you currently have on your environment.
Hope it helps.