Sec. 4. (a) If the state establishes that the person who is the subject of an expunction order is still subject to conviction for an offense arising out of the transaction for which the person was arrested because the statute of limitations has not run and there is reasonable cause to believe that the state may proceed against the person for the offense, the court may provide in its expunction order that the law enforcement agency and the prosecuting attorney responsible for investigating the offense may retain any records and files that are necessary to the investigation.
(a-1) The court shall provide in its expunction order that the applicable law enforcement agency and prosecuting attorney may retain the arrest records and files of any person who becomes entitled to an expunction of those records and files based on the expiration of a period described by Article 55.01(a)(2)(A)(i)(a), (b), or (c), but without the certification of the prosecuting attorney as described by Article 55.01(a)(2)(A)(i)(d).
(a-2) In the case of a person who is the subject of an expunction order on the basis of an acquittal, the court may provide in the expunction order that the law enforcement agency and the prosecuting attorney retain records and files if:
(1) the records and files are necessary to conduct a subsequent investigation and prosecution of a person other than the person who is the subject of the expunction order; or
(2) the state establishes that the records and files are necessary for use in:
(A) another criminal case, including a prosecution, motion to adjudicate or revoke community supervision, parole revocation hearing, mandatory supervision revocation hearing, punishment hearing, or bond hearing; or
(B) a civil case, including a civil suit or suit for possession of or access to a child.
(b) Unless the person who is the subject of the expunction order is again arrested for or charged with an offense arising out of the transaction for which the person was arrested or unless the court provides for the retention of records and files under Subsection (a-1) or (a-2), the provisions of Articles 55.03 and 55.04 apply to files and records retained under this section.