UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'x3I0IBYc2JEGr30ZZgRe/hZrgwYAkrIUb1QopW3G4KY='
WHERE
key_id = '13222d526f96a80bdde6869627760b76d3a6e2b8f8bd9e2c7aa3d89c4584f27f'
AND (
token = 'x3I0IBYc2JEGr30ZZgRe/hZrgwYAkrIUb1QopW3G4KY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)