UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GRqcsorZDFEowaM50j55HsBLJvMd21e7aW3zwbBY6U8='
WHERE
key_id = 'acccf9cd3e5b71cbe7eb2042f444b1ffb7c859544def203e8f983f78dc9c1e7b'
AND (
token = 'GRqcsorZDFEowaM50j55HsBLJvMd21e7aW3zwbBY6U8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)