UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iii0HdvQ4KI/hyT/ysBZFiX9pg1q3YvVoJd90epeeRM=' 
WHERE 
  key_id = '3f5cc42cb1dde14afc1c91e7f4dc24fc673faa56f2030055283c5b954dafd8d4' 
  AND (
    token = 'iii0HdvQ4KI/hyT/ysBZFiX9pg1q3YvVoJd90epeeRM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022