If the prisoner is admitted to bail and fails to appear and surrender himself or herself according to the condition of his or her bond, the court by proper order shall declare the bond forfeited; and recovery may be had thereon in the name of the state as in the case of other bonds or undertakings given by the accused in criminal proceedings within this state.