UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7w+Oj4B4UXpqfldDhTMvHyXPSNTTL0zBg4pTbpVfCpM=' 
WHERE 
  key_id = '364955913125b0a46c63585a885201ba5215ea70087707a57d8162c62b98bcf1' 
  AND (
    token = '7w+Oj4B4UXpqfldDhTMvHyXPSNTTL0zBg4pTbpVfCpM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039