UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qFul5CIJiw9ZhKd0PqbHt2cOJk4v1XfsIpKBGFFbkOc='
WHERE
key_id = '71f59d39f1acdf93f8d91c4a6d3cfd107436aa3902234070c90d65f39fc0d130'
AND (
token = 'qFul5CIJiw9ZhKd0PqbHt2cOJk4v1XfsIpKBGFFbkOc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)