UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '85fLBCypW+d8Tob3U2Ovn839iVmapO2IjSVKMJykNmc=' 
WHERE 
  key_id = '8d9ff36f6ec383b203a8edae9bf3af87eb9f6f564340d3c195b7a201130bbfc0' 
  AND (
    token = '85fLBCypW+d8Tob3U2Ovn839iVmapO2IjSVKMJykNmc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030