UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BUSm5dIvC4qeqGfSVYTgY71N+uC513aiIqfv7Ecnatw='
WHERE
key_id = 'e7c3f3cabdcfe27190151d9b2ad8b03008b63b6f432fb680dfcb94420a62f1c5'
AND (
token = 'BUSm5dIvC4qeqGfSVYTgY71N+uC513aiIqfv7Ecnatw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)