Stamets basically has his memory backed up in a cloud - the mushrooms give him pretty explicit separation of mind and brain here, for a certain value of mind at least. I don't think he's supposed to be a beneficiary of the crystal effect in any way. Although it probably hurts to have fifty-plus recollections where there should only be one.
What happens to Mudd is less clear. So, the obligatory headache-inducing recap of possibilities:
Does his whole body bail out of the timeline as if transported (i.e. if he did get stabbed, he'd stay stabbed, and when Stamets blows everybody up, Mudd nevertheless escapes in the nick of time), then get deposited on top of his body 30 minutes earlier? Does just his mind perform the jump and depose whatever is in Mudd's mind those 30 minutes earlier? Echoes of "Tomorrow is Yesterday" here.
Could be a pure "timelines" thing. In perhaps a hundred of them, Mudd suddenly sort of ceases to exist at T=30, but Lorca stays dead or the ship stays blown up or whatever. In perhaps a hundred minus one of them, Mudd suddenly appears at T=0, blasts his local version to oblivion (as both grin in anticipation of future greatness), and takes over his timeline to run yet another loop.
Or then neither Mudd's body nor his mind manages the loop. Rather, his crystal doodad sends him a record he studies for a while (it gets sent to T= minus 24 hours or whatever, so he has time to rest and assimilate) and then goes where many Mudds have gone before.
Then again, it could be magic. Time does "restore" itself in all of Trek, smoothing over any paradoxes or complexities. The time crystal thingamajig need not be capable of any of this smoothing as such (any more than a decrepit BoP flying anticlockwise around Sol is), but its makers know that time is kind and accommodating, and justly rely on that.
Timo Saloniemi