The sheriff's office may immediately close an establishment licensed under this chapter in case of emergency for the safety of the public or to investigate a crime for a period of time not to exceed 24 hours.