With a P0524 you want to verify that it's a bad sensor or actually low oil pressure. Continuing to drive with low oil pressure can quickly cause severe damage to your engine requiring extensive and expensive repairs.
You will need to directly measure the car's oil pressure with an external oil pressure gauge. These are relatively inexpensive but finding and getting to the proper place to measure the pressure may be tricky and it's likely the same place that the potentially bad sensor mounts. You may be better off taking it to a shop that can do this for you if you are not comfortable with this type of work.
P0021 could very well be a related code and it may be due to the ECU being confused about how much input the cam position actuator needs or may be due to an actual oil pressure issue. I would address the P0524 issue first and see if this one clears up on its own.
As far as actually having low oil pressure I assume you have checked the most obvious potential problems:
- Low oil level.
- Clogged oil filter.
- Improper oil type or viscosity.
Apart from this you may have a clogged oil pickup screen in the oil sump, you may have a clogged oil line, you may have a worn or damaged oil pump, you may have a cracked block or cylinder head, you may have a head or other gasket problem.
In all these cases we're talking about significant repairs. Good luck!
If the pressure is normal, then you know you have a bad sensor. Change it.