This is one of the reasons why developing good game music is much more difficult than may be assumed. Anyway, instead of using the system time, you should use the timer(). It keeps an ongoing upward count from when the machine was turned on. And it's precision is in 1/1000 of a second so that should give you more flexibility than the system time.
If you use the looping (iterations) and the sync rate is 0 as your music syncronization, then the timing could be anywhere on any machine so that brings us back to using the timer() again to manage the syncing. There should already be contingencies in the game to keep it at the same speed no matter what computer it is on.
As far as the actual music, a technique to use is to break a long piece of music into small modules. The design of the music should be such that almost any module can lead into or follow another. So if there was a character walking, there could be a general them and a set of modules follow a certain order. If the character suddenly falls through a hole, then on a trigger play that particular action module on top of or instead of the currently playing module. If the music is written properly, then they can blend. If not, the modules have to be small enough to fit into certain timing thresholds. If the character is walking then starts to run, you can fade out the general theme and fade in the running module.
Most of the modules can be controlled by events such as keys pressed or the appearance of an enemy or the position in the world the character moves to. Control the music very much like you would control sound effects, just make sure that the small sections of music can blend well with each other so it sounds like a dynamic piece all under the same theme.
For the mining cart, say you have way points or markers along the track. When the cart reaches a certain point, new music plays or stops. Again this ties in with the modularization of the music.
Say it was a classical based piece of music. Perhaps there is an underlying simple repeat of low violins with sort of a quick looping series of 3 or 4 notes with a sense or urgency. As the cart was rolling along, say it hit a bump, at that point you could have an orchestral hit of all the instruments (as a separate sound) that's triggered by the collision. It's in the same key as the droning repeat, but it's a small module of an orchestra blast that emphasizes the event and seems like the orchestra is coordinated with the game.
The short version, make small modules of the music that can be used interchangably, trigger the music by game events/character positions/triggers, and use the timer() for any timing coordinated syncronization including the overall game speed.
Enjoy your day.