No person shall be twice put in jeopardy of life or liberty for the same offense, except, when on his own motion, a new trial has been granted or judgment has been arrested, or where there has been a mistrial legally ordered under the provisions of Article 775 or ordered with the express consent of the defendant.