Use Discord.js/Node.js/NeDB to Remove Role From User After X Number of Hours

I’m relatively new to Javascript and Node, but I have managed to create a bot for my discord server and implement a basic economy, granting points based off of post submissions. These points are stored in an NeDB. I’d like to allow users to redeem points to give someone a specific role for X amount of time.

I’m not sure how to even begin approaching this problem. Do I log a timestamp in my NeDB database with the user ID, and then somehow check this database at regular intervals to see if the timestamp has elapsed? Can I do this without blocking the bots other regular functions and command responses?

Additionally, how might I make the code robust so that if my bot disconnects unexpectedly, the user is not stuck with the temporary role?

I’m curious how someone with programming experience might approach this problem, and what solutions might be available that I don’t know about.

Thank you so much in advance!