Unlike with pillar 2, there is no lock in period with pillar 3a. However you can only retrieve funds every 5 years and no repayments are possible.
https://www.credit-suisse.com/ch/en/...ng-201905.html
If you are married the rules are for each spouse separately and independently. Be aware that to be able to pay into pillar 3a one must have an income subject to AHV/OASI. If pillar 2 is paid the contributions are capped at CHF 6'826 (adjusted every year), or if no pillar 2 is paid the contribution is capped at 20% of the net income.