UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MX8TKuXcgMMInhhjozQFueaf7uGOOBGhWMiK+AW2bpg='
WHERE
key_id = 'ebe6f123df4a6d461ca87d9b62714e3de7bb80410a85eb13e142fda37cab1fb3'
AND (
token = 'MX8TKuXcgMMInhhjozQFueaf7uGOOBGhWMiK+AW2bpg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)