UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oykPvArq/ggpsYRqjMKrnIKdBaSmNzuqVoY5of5pQPI=' 
WHERE 
  key_id = '92147dceb99dfdd9f3aa451b926b401bd8b63a10de488036f550e028e5287bf2' 
  AND (
    token = 'oykPvArq/ggpsYRqjMKrnIKdBaSmNzuqVoY5of5pQPI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044