UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'etIuCf2voFp6uenq8fKnSC52pnAtR7mTAIb/eKsAdPU=' 
WHERE 
  key_id = '5e8c3dd1fb591cbbb5a54ff467a332c69893e88c8ed4c3ed23f96f0356a95da4' 
  AND (
    token = 'etIuCf2voFp6uenq8fKnSC52pnAtR7mTAIb/eKsAdPU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045