UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/1uG4s2MibvlPNCSqVBARrZTwhhxPvHMGdzLmJAZhqU='
WHERE
key_id = 'ebb1bd6fcc9d5924982307dcda93409cb9e73234124985a3132f48e5857268d1'
AND (
token = '/1uG4s2MibvlPNCSqVBARrZTwhhxPvHMGdzLmJAZhqU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)