If any person committed for treason or felony, plainly and specially expressed in the warrant of commitment, upon his prayer or petition in open court the first week of the term to be brought to his trial shall not be indicted some time in the next term after such commitment, the judge of the circuit court shall, upon motion made in open court the last day of the term either by the prisoner or anyone in his behalf, set at liberty the prisoner upon bail, unless it appear to him, upon oath made, that the witnesses for the State could not be produced at the same term. And if any person committed as aforesaid, upon his prayer or petition in open court the first week of the term to be brought to his trial, shall not be indicted and tried the second term after his commitment or upon his trial shall be acquitted, he shall be discharged from his imprisonment.
S.C. Code § 17-23-90