If you want to do this with mysql, you will need to use a statement INTERVALthat will allow you to “add” functions from time to time ... for example:
UPDATE table
SET data = 'whatever'
WHERE NOW() - INTERVAL 3 HOUR < last_change
Here you can find additional information and examples: Date and time functions
source
share