UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HBOi1ZOXupsvx/9azCQBU0V0kQXaE797/FB9I+tiH7E='
WHERE
key_id = '1884d5b76b821e6ba8b8194f91e480d58bad498c6dbbaf56e18d56d0af33536b'
AND (
token = 'HBOi1ZOXupsvx/9azCQBU0V0kQXaE797/FB9I+tiH7E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)