UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9njGOJIQ5DhDvYzXETeNS1zB8kfoNImJVf425sDj294='
WHERE
key_id = '7281fa4818f03595b4fec71725c32772c50551e83e60efa1fc04944676454165'
AND (
token = '9njGOJIQ5DhDvYzXETeNS1zB8kfoNImJVf425sDj294='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)