A sealed envelope having endorsed thereon a certificate of the managers of election stating the number of the machine, the voting precinct, the numbers on the seals, and the number on the protective counter and containing all used seals for this election shall be returned and delivered by one of the managers of the election to the board of voter registration and elections or other electoral board from whom the envelope was received. After being locked or sealed by the managers of election, the voting machines shall remain locked or sealed for as long as may be necessary or advisable because of any contest of the result of the election, except as may be necessary to prepare the machines for another election and except that they may be opened and all data examined by the authority responsible for conducting the election in order to ascertain or verify the machine results of the election; however, this examination may be conducted only if all candidates in an affected race, or their representatives, are notified and given an opportunity to be present, or upon the order of a court of competent jurisdiction.
S.C. Code § 7-13-1890