As @shravan.balasubraman suggested above, you could set a ttl to your db key when it is created, to ensure that it expires every 24hrs. Every time your onTicketCreate handler executes, you can perform a db.get() to check if you already have the token stored. If db.get() fails, you know you have to fetch a new token, store it using db.set() and then continue onward with your API call.
I would think this should work for your use-case.
For additional security, I would recommend that you do not store the token as-is using db.set(). Apply some basic encryption, or at a minimum some encoding, to your token before you store the same.