In a ring game or early in a tournament I will fold middle pair almost instantly. If you only have 5 outs (3 outs to make 2 pair and 2 outs to make trips) it's almost always a good fold in a multiway pot. Early in a tournament especially, since your chips are more precious. If you are heads up though it is more common that your opponent hasn't paired up though so I might hang onto it longer.