Wow, that's a big number. I honestly don't know how to do this one; solving these count-up levels tends to be trial and error/intuition based, and with a number this big, it's unrealistic to do the trial and error method. Perhaps I'll figure out a trick to this at some point, but there's a decent chance I'm not gonna figure this one out.
I went and crunched the numbers on it, there are technically quite a lot of solutions, some even doing better than the given Master Key count. There's a lot of layers to unpack, but there is a general strategy for this problem which, while not giving the perfect sequence (as there are several), will still give you something good enough to solve it.