What you ask are pretty much default in all dashcams.
The auto saving / locking however can let some people down as it can work in several ways.
1: use of a memory buffer in the camera, this generally mean you will just get locked seconds before the actual event, and most often also just seconds after.
2: segment handling. This mean the camera will deal in the video segment size you have choose to use, i prefer to use 3 minutes but most camera give the option for 1 - 2 - 3 - 5 - 10 minutes,,,,,, 1 and 10 minutes i would not go near for any reason.
Anyway so in case of a event the camera will lock / save the current segment being made, the problem is if you are right at the start of the current segment you will have little before the event, same if you are at the end of the current segment when the event happen in that case you will have little after the event.
3: multiple segment approach. To my knowledge only the street guardian brand use this, this mean if you are less than 50% into the current segment when you have a event, the previous segment + the current one will be saved, in my case using 3 minute segments this mean i get 6 minutes of video locked.
If you are more then 50% into the current segment the same happen but now the current segment get saved + the following one.
In either case you using 3 minute segment size will at the very least have 1,5 minute saved from before and more after.
BUT ! Anyway you should not focus too much on this aspect, the camera record and save all the time, so as long as you do not have a silly small memory card that will never be a problem and what are not locked in read only mode of your event will still be there just in and among the regular footage.
So even if you crash down a mountainside and sit there with power on / engine running and are not using auto event creation, with a proper sized memory card you will still have to be there for many hours ( +10 ) before the camera get around to overwriting the event itself.
Personally i do not use automatic event creation while driving ( G-sensor ) if i can halp it, but some cameras dont have a off for this only a low setting,,,, which will still be plenty to trigger in case on something major.
The problem is if the G.sensor are too sensitive, potholes ASO might well create false event recordings, which in the old days would fill the memory space set aside for events, today this is not a big problem as even this area of the memory card will also overwrite oldest footage if full,,,, and again worry not with a ample sized memory car d there are room for many many events in that range.
As i said i dont use auto save / lock of events, #1 in accident response here is stop the accident from getting any worse ( traffic ) and #2 is turn off the engine on cars involved,,,, and this will also stop the camera recording.
you should not consider a memory card smaller than 128 GB these days, 256 will be fine for a 2 camera system.
If it is a small event, i might well turn off my car engine but keep the car key at ACC so my cameras will continue to record, thic can always be useful with the many low life people out there.
But if you are hard wired for parking guard turning the car off, will send the camera into parking guard mode,,,,, but here there also are a few things to be aware of.
So with plenty of memory card space, there is no problem having your teen drive the 3 hour drive to the cabin at the lake with the friends, spend all week there and probably drive some more, and then drive home again next sunday, and it will all be there even with no automated events needed.
Of course if G-sensor are on, and the camera setup do not generate too many false events, it will be faster to find the actual event by going strait to the RO folder ( Read Only ) used by many brands to store the event files, some might call the same folder event, but its the same thing where the automated locked events go to live safe from automatic deletion once the card is full.
With a large memory card and say 4 hours of daily driving, you will have many days on a large memory card before it fill up and start to overwrite the oldest recordings.