UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rAkULV0GdEoRp2TffMeZPN63WrBWz8mj9pB6XpqjDgo='
WHERE
key_id = '3a005869374fff596673baa046b5208565dcac8d89670def3d88120c1ee1c8a5'
AND (
token = 'rAkULV0GdEoRp2TffMeZPN63WrBWz8mj9pB6XpqjDgo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)