Kylian Mbappe scored all four goals as Real Madrid hung on to beat Olympiacos 4-3 in the Champions League on Wednesday and end a three-match winless run in all competitions.