Let x = speed of boat in still water
Speed downstream = x+5
Speed upstream = x-5
Distance = (Rate)(Time), so Time = Distance/Rate
Time upstream = Time downstream
So, 20/(x-5) = 30/(x+5)
Cross multiply to get 20(x+5) = 30(x-5)
20x+100 = 30x-150
10x = 250
x = 25 km/hr