UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'm6QynBAKTKw+823dPGQbYs2M/osOBoIwpU9Y9zBNJJM='
WHERE
key_id = '588029654ca1f93a70849a1cdd9987319044776b92efbfcd78fe06a553ec1e6c'
AND (
token = 'm6QynBAKTKw+823dPGQbYs2M/osOBoIwpU9Y9zBNJJM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)