If you wake up at Mghrib time, you should pray the missed prayer in order and then pray Maghrib, as long as you will pray Maghrib on time.
If you are going to pray Maghrib in the masjid, you can pray it first and then pray the missed prayers in order.