can anyone help me or point me twards a way to set up a script that will delete a user after a specified period of time.

I am trying to allow only 24 hours(1 day) access to a section of my site, and I want to be able to allow users to get a random password out of MySQL db but then it deletes after the specified time. Is it possible to do this?