UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UzIBKIbJ9rTmY04h9Glc80dPPi0CY1BCW9Fcchv/gE4='
WHERE
key_id = 'b27409bc60c5d45f6dd9bf9c74936a46655c6c8480dc890e54956eb1b6487042'
AND (
token = 'UzIBKIbJ9rTmY04h9Glc80dPPi0CY1BCW9Fcchv/gE4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)