Issue #2305649 by slashrsm, damiankloip: Fix/update expiration logic.