Generate a one-path maze Given an odd integer N (5 &lt;= N &lt;= 51), generate a maze with side length N that follows the following requirements:

The maze must be composed of the characters  | - and +. It must use the | character as a vertical wall, the - character as a horizontal wall, and if that wall turns, the character + should be used.

The width of the path must be one character.

The maze must turn at least four times.

The maze must have outer walls, that break at two points: the start and the end.

The maze must consist of one non-breaking path, from the start to the end.

For example, the following is a valid maze: (N = 5)

+---+
|   |
| | |
  |  
--+--


And for N = 7:

--+---+
  |   |
| | | |
| | | |
| | | |
|   |  
+---+--


Remember, this is code-golf, so the code with the fewest number of bytes wins.
Jelly, 36 35 34 33 32 bytes

2*×5H_2Bị⁾ |
_3”-ẋ”+;;Çsẋ2U3¦ṁµY


TryItOnline!

Builds a nighter™ the other way around to the examples like:

+---- |
|     |
| ----+
|     |
+---- |
|     |
| ----+


How?

2*×5H_2Bị⁾ | - Link 1, pipes &amp; spaces: n      e.g. 7
2*           - 2 raised to the nth power      e.g. 128
  ×5         - multiply by 5                  e.g. 640
    H        - halve                          e.g. 320
     _2      - subtract 2                     e.g. 318
       B     - convert to binary              e.g. [1,0,0,1,1,1,1,1,0]
        ị    - index into (1-based)
         ⁾ | - char list " |"                 e.g. " ||     |"

_3”-ẋ”+;;Çsẋ2U3¦ṁµY - Main link: n            e.g. 7
_3                  - n - 3                   e.g. 4
  ”-                - char list "-"
    ẋ               - repeat                  e.g. "----"
     ”+             - char list "+"
       ;            - concatenate             e.g. "+----"
         Ç          - call last link (1) as a monad
        ;           - concatenate             e.g. "+---- ||     |"" 
          s         - split into chunks of n  e.g. ["+---- |","|     |"]
           ẋ2       - repeat 2 times          e.g. ["+---- |",
                                                    "|     |",
                                              +--&gt;  "+---- |",
                                              |     "|     |"]
              3¦    - apply to index 3:       |
             U      -    upend                +---  "| ----+"
                ṁ   - mould like n (i.e. repeat to fill)
                 µ  - monadic chain separation
                  Y - join with line feeds


(each byte saved involved fairly non-trivial changes, see the edit history if you're interested, although I just noticed that Link 1 is the same byte count as the more conventional repeat and join: _2⁶ẋ“ ||“|”j)