Researchers looked at the diets of more than half a million people over more than two decades to determine their affect on longevity