UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zSi+2B934SzD2dcZ/g2aviuCMRNJgn8WlB/S08D1n4c=' 
WHERE 
  key_id = '3e39cc7e82f41bf624b7705e8ffb365132dc53e06b8b2d42aca6609abf44aca4' 
  AND (
    token = 'zSi+2B934SzD2dcZ/g2aviuCMRNJgn8WlB/S08D1n4c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016