UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oMqSqyJtIdAU4inMxAeamO0JiSPcAuKcyPfUp3zIFrc=' 
WHERE 
  key_id = '4cce59c890081a5c8ea0b3bd96d5f6957bc60288dfc5d88445eff098705302d7' 
  AND (
    token = 'oMqSqyJtIdAU4inMxAeamO0JiSPcAuKcyPfUp3zIFrc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039