Too many coaches try to reinvent the warmup into a huge technical ordeal. Warming up prior to a race shouldn't take too much focus which is best saved for the event. For road cycling prior to a short fast race a solid generic warmup is just spin the legs for 5 minutes then go into a progressive 12 to 15 minute ramp up going thru heart rate zones 1 to 5. Afterwards cool down for 5. This should put you in the ballpark for a solid start.
In mountain bike racing try pre riding the course or part of it to engage your technical skills and familiarize yourself with the course. With mountain bike racing after you warm up you'll likely spend a long time on the start line so you'll generally cool way down. If it's a shorter race you'll end up going out pretty hard so it's important in training to practice hard front loaded efforts when cold. Typically in training practice 2 minutes all out followed by 5 minutes at tempo. Set aside an occasional training ride for these efforts and try 3 or 4 of these sets in one training ride. In between sets stand around for 5 minutes or so before attempting the next effort, this should help prepare you for hard race starts.