Their content is a secret and not revealed until purchased.
They range in Rarity from Common to Ultra Rare.
Once purchased, you'll receive a random Unlockable as a reward whose rarity can range from Common to Ultra Rare. Perks cannot be obtained from a Mystery Box.
Mystery Boxes used to have a chance to spawn in every Bloodweb Level. Now they will spawn at Levels 3 & 5 and then in every fifth Bloodweb.
During the Winter Solstice Event, the Developers added special Mystery Boxes to the Bloodweb, that spawned in every single Level, and twice every 5 levels and contained a new Reward each time. They were removed with Patch 1.9.0.