Mustard is one of those simple condiments to make, and is fun to experiment with. At it's most basic mustard is two ingredients:
There are endless variations from there.
Mustard seed comes in white, yellow, brown and black variations. I suggest buying whole and grinding them yourself using either a mortar & pestle or coffee/spice grinder. (Don't use a coffee grinder that you use for grinding coffee! You'll end up with mustard flavored coffee).
Liquids can be water, vinegar, wine, or even beer. Using vinegar/wine will help it last longer than water or beer would.
Once you've fine ground (of course there are coarse ground varieties too) your mustard simply mix it with the liquid until it is the desired consistency.
Additional ingredients can be added to taste. Honey, turmeric (gives yellow mustard its color), sugar, etc. are all possibilities.
Update: I forgot to mention that mustard needs time for the flavors to mix. This can take anywhere from a few hours to weeks. A fresher mustard tends to be hotter, but an aged mustard can often taste "better" with a slight loss of that initial heat. Refrigerated mustard will keep it's heat longer. Also note, mustard made with water should definitely be refrigerated and consumed quicker than others.
Whey appears to be an agent for lacto-fermenting mustard. This recipe for lacto-fermented mustard describes a process of combining ingredients and then letting them ferment after the recipe is put together by leaving out over a few days.
This recipe for a mustard seed raita uses yogurt as the fermentation ingredient, which means that you would have to use yogurt with active cultures.
Best Answer
Mustard often separates, it doesn't mean it's going bad. It's likely perfectly fine, mustard stays good for years in the refrigerator. Just stir it up before using it to recombine.
As for why it doesn't separate unopened, sometimes it does. Often you are buying a product that's been manufactured recently, so it hasn't had time to separate yet.