UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'keOPGFcFSRo6bpP/wL7cACyvoz+9Gjj1kHCgXcIr3KY='
WHERE
key_id = '91dea549b63a491ffcbbf2a1d10d3fa31427a1402138b4d73a8be6417780906b'
AND (
token = 'keOPGFcFSRo6bpP/wL7cACyvoz+9Gjj1kHCgXcIr3KY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)