UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zlnxXa0aR7sR89B99zvzKvxSpccLlJs3U0OTVoNu0ZQ=' 
WHERE 
  key_id = '8cd35048406f6ccda271c8ad50ce77571bfebf29538b2e5c5c6a240533f84f6f' 
  AND (
    token = 'zlnxXa0aR7sR89B99zvzKvxSpccLlJs3U0OTVoNu0ZQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036