I think that one might lead to the other. If we invest our time in longevity then we will possibly live longer, thus be able to explore the cosmos longer; or does greater longevity lead to humans greater demise sooner? I personally would choose space exploration over longevity.