Static Water Level?
Whether a shallow well pump can pump water from a 40' well depends on the depth to the water from the surface (Static Water Level) and the gallons per minute (GPM) that the well can supply. A shallow well pump can effectivly pump water down to 22'.
An impractical solution is to place the pump 20' in the ground by the well. Such as digging a large diameter (dug well) to 20' and placing the pump in the dug well and connect the pump to the 40' well at 20' ft.
I've done this in developing countries where there is no other option other than drilling a new 4" well and installing a submersible pump.