UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lYN2QAoX5rjmnsK7JuKdAg0NtKROsXJ7xL+4HzMWtho='
WHERE
key_id = '23645d0fd2abf9f1fe7955f1bb2d70ee58ad399d7c7f97efab3702c20ea61729'
AND (
token = 'lYN2QAoX5rjmnsK7JuKdAg0NtKROsXJ7xL+4HzMWtho='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)