A brighter outlook could translate to a longer life