I would judge it by the most sensitive ingredient.In this case it would be eggs. Milk products just get curdily and nasty like. The concept of making you sick is pretty limited because just looking at it would put you off...LOL!
You might want to check with the egg counsel and see what kind of specs they have on "cooked" eggs and custards.
I would seriously doubt that some of the flans and custards that you can buy preprepared in the market have a whole lot of preservatives going on so you might want to check shelf life for those as well.
Personally I used to make pastry cream often (pastry cream is my friend) and as far as quality goes it would last about a week in the walk-in at 38 degrees (presuming I didn't use it before then)
Of course I have no idea what application you're using it for or need it to last but hope this will point you in the right direction.