As stated by Barmar in their answer here:
DELETE FROM my_table WHERE timestamp < NOW() - INTERVAL 30 MINUTE
Write a PHP script that executes this SQL, and add a crontab entry
that runs it every 30 minutes. Or use the MySQL Event Scheduler to run
it periodically; it is described here.
18
solved deleting item from database after 30 minutes [duplicate]