Select the cells that should be locked and then use:
format|cells|protection tab|check lock
Select the cells that should be unlocked and uncheck that setting.
Depending on the number of cells of each type, it may be easier to lock (or
unlock) all the cells and just unlock (or lock) the others.
Then you have to protect the worksheet
Tools|Protection|Protect sheet
(give it a nice password)
Be aware that this kind of protection is easily broken and that there are lots
of things that are unavailable on protected sheets.
You may want to do some testing to see it still fits your requirements.