UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ycl+SPJOhkU4qMWZ2IZ/Bl+9rQNYyHRHZqW4XhvaKOQ='
WHERE
key_id = '9000f2e3634c1a1cfac1e94170c1556353af5f47e1ac5dc3021cf50cbe3ced3b'
AND (
token = 'ycl+SPJOhkU4qMWZ2IZ/Bl+9rQNYyHRHZqW4XhvaKOQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)