Fix illogic usage of db expired