Are you using these sleep statement to wait until after the expires time passes? Rather than doing that, would it be possible to just set the expires time to the past? sleep statements can really add up on our test time, and they aren't necessary in this case since you could just simulate the same situation by setting past expires times.