UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '45EEf80487mB0uXH2VhI8wNl/DHsI6C/iKZ51yUa4Wo='
WHERE
key_id = '7157f170f5e21b8d5da2fb623dc64abdf8afbc7a42af82e7ad27b7f08d82aba7'
AND (
token = '45EEf80487mB0uXH2VhI8wNl/DHsI6C/iKZ51yUa4Wo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)