I've got a flight from Marrakech to Madrid, with a 50 minute layover in Casablanca. Also, I'll need to go from Terminal 1 to Terminal 2 in Casablanca. Is this enough time?
This source puts the "international-to-international" time in Mohammed V International Airport at 50 minutes. Since you will also have to clear whatever exit formalities Morocco imposes, you probably won't make it.
And that is not even taking into account the time it will take to explain the whole story to Lazlo, kiss Ilsa goodbye, and shoot Major Strasser.
There is a three minutes walk between terminals. However going through police control might well take more than an hour, it's pretty nightmarish in Casablanca.