UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3gi54EqgSuaFFSFwkaIXBUaJF78MbPaZ77IXBAgDXrE=' 
WHERE 
  key_id = 'fc2696d9e3f64abc99ceda7c061738efc5f233de84ecfc277faff2c9873264f9' 
  AND (
    token = '3gi54EqgSuaFFSFwkaIXBUaJF78MbPaZ77IXBAgDXrE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00078