I have a MySQL database that contains records with an expiresAt timestamp. When this timestamp is reached, I want to execute some code to update the record.
I've considered using a background worker process with a cron job to periodically check for expired records, but I'm not sure if this is the most efficient approach. I've also heard about database triggers and MySQL events, but I'm not sure how to implement them using PlanetScale.
What are some best practices and recommended approaches for executing code when a timestamp is reached in a MySQL database hosted on PlanetScale using Prisma and Node.js?