2002 explorer sport door locks non keyless entry

both the front doors won’t unlock with the key rite away. when they do open they work fine until the key is removed. the rear hatch work’s fine all the time. one key is a new dealer programed key.both keys do the same thing. any help

Go to the hardware store and get graphite lubricant for lock cylinders. Pump a couple of puffs into the key slot, then put in the key, and work it in by locking and unlocking the door a few times. That should free it up.