UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nZgC+MjIJoUWRaZ/eK5hUh4qupUpQt2WalilFSAsGBw='
WHERE
key_id = '9914a776b2d6080e6f7f7b07c1e1f3a0e4b7e794f9e4c17193ffe6f256ffba97'
AND (
token = 'nZgC+MjIJoUWRaZ/eK5hUh4qupUpQt2WalilFSAsGBw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)