Average speed is total distance over total time. The distance is 90+90=180 miles. The times are 4590=2 hours out and 3090=3 hours back, a total of 5 hours.
average speed=5180=36 mph
The mean of 45 and 30 is 37.5, but more time was spent at the slower 30 mph, so the true average is lower.