selftest: Make setexpiry test much more reliable