UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xn4P0Y2C6/V2roVLFOBa7HYIK/RMYqchc6+tSDny3CE='
WHERE
key_id = '3246bbaaad87650c0ca95ad9e6456df885688e1ad3f46b9a6e2e87d15b2ce37a'
AND (
token = 'xn4P0Y2C6/V2roVLFOBa7HYIK/RMYqchc6+tSDny3CE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)