Larger numbers of people are living to retirement and old age, posing a threat to the financing of the welfare state. In Denmark, statutory retirement age is increasing gradually to account for changes in life expectancy. However, the chances of reaching retirement age are not equal across the population, and raising the retirement age could disproportionally affect those from lower socioeconomic backgrounds. In this paper, we investigate socioeconomic inequalities in mortality before retirement age or shortly thereafter in Denmark. We use Danish registry data over a 30-year period, focusing on individuals aged 50 to 70. We perform sex-specific survival analyses across socioeconomic groups using three measures of socioeconomic status: education, income, and occupation. We observe an increase in survival inequalities over time between the lowest and highest socioeconomic groups for each measure. The reason for the widening gap lies in minimal mortality improvements in the lowest socioeconomic group. These results are complemented by lifespan inequality measures, which have the same mortality trends. We show that individual level variability in socioeconomic characteristics play a crucial role in defining the survival chances just before and shortly after retirement and thus should be accounted for in designing retirement policies.