1. You know the time when it has travelled 40meters, and the constant acceleration during that period.
Use this info to determine the initial velocity, from the equation giving you the distance travelled as a function of t.
2. Determine the value of "t" when the car has travelled 20 meters (from the same equation for the position).
Insert that value of "t" into your expression for the velocity at time "t".