So I\'m currently designing a Forgot Password feature for a website. Basically, when the user clicks forgot password it sends them an email with a reset token. I want the re
I'd use MySQL Events for that:
CREATE EVENT IF NOT EXISTS `dbName`.`eventName`
ON SCHEDULE
EVERY 1 DAY // or 1 HOUR
COMMENT 'Description'
DO
BEGIN
DELETE FROM `dbName`.`TableName` WHERE `expireDateCol` < NOW();
END
and enable the MySQL Event Scheduler , see original source.
source: https://stackoverflow.com/a/24568566/2069181