UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LeTBhvguqCHrs6brqxLk7Tej+LJIHc9rwsWkGxOaXEo='
WHERE
key_id = '70c24036bea3de915f727308540bb6a211e7c95ccd99d3138e0adf8cbbd4d84a'
AND (
token = 'LeTBhvguqCHrs6brqxLk7Tej+LJIHc9rwsWkGxOaXEo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)