UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VRy+8YADTvwQKlQ4ncUWfyZ65BdKmusQo2MvjmpqTsA='
WHERE
key_id = '7f6f2ac2c24ef1e2be85b9a89b5ca62b88be2d66837fed295cbde3edd54315f5'
AND (
token = 'VRy+8YADTvwQKlQ4ncUWfyZ65BdKmusQo2MvjmpqTsA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)