UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eWvrcsy/xYrP1CqAdp3UlBspN4lBvgrxQH1OhvZppVg=' 
WHERE 
  key_id = '5a48039018a19371492f86164351ec0f98fb3875f72dbca0f54340c160d317ed' 
  AND (
    token = 'eWvrcsy/xYrP1CqAdp3UlBspN4lBvgrxQH1OhvZppVg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037