UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qQUQAKXk7SFNk2Tvg+OWd3zJWHfF/L/kOcdzzc1aTD8=' 
WHERE 
  key_id = '3a6137e61ec7e324f7388a4b5c8e8c059703e53cc56786f1bf42f0bea3241aea' 
  AND (
    token = 'qQUQAKXk7SFNk2Tvg+OWd3zJWHfF/L/kOcdzzc1aTD8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029