Do not allow setting an expiration date in the past

Fix #7297

@PVince81 @karlitschek @schiesbn