I am using a MySQL database on a LAMP stack. I have a table in which I got some simple entries. These entries are supposed to automatically be deleted after ten minutes not being used. "being used" is defined as being inserted, updated or simply requested through a SELECT (obviously delete is unimportant). I would like to use pure MySQL for this, but could not find a solution yet. The fields can have a table.time_used property if required, but do not have it yet. It would be no problem to create one though. I was thinking of some TRIGGER and PROCEDURE combination, but could not figure one out yet.
I know I could use some third-party application like cron, but I would prefer a MySQL solution because the project may be copied to other environments where cron is not an option.
I also know it is possible to do this by changing the SELECT statements using the table and a table.expiration_time field which would likely be more exact too, but I do not need it to work on the second, I just need roughly ten minutes and would like to keep it clean, as this may run on very limited machines.
Thanks in advance! :)