By the rules - probably not, but a DM might allow it as a houserule
The rules say that while you are wielding the shield you automatically get the bonus to your AC. So while you are holding and using the shield you are assumed to be getting that bonus at all times. There is no mechanism in the rules for turning this bonus on and off. The same thing applies to your armor bonusDexterity bonus to AC.
If you want to say that your character is foregoing that shield bonus, say by flinging your arms wide open so the shield is not protecting you, then you must ask your DM if they will allow that to reduce your AC for that attack.
It makes less sense narratively and mechanically to allow this to happen with a character's armor bonus to AC though since there is not an obvious way to modify your armor to be less protective instantaneously. However, it is within the DM's perview to handwave this concern away if it does not bother them/anyone at the table (I think I wouldsuppose the same could be disinclinedsaid for foregoing your Dexterity bonus to allow this personally)AC as well seeing as you can say that narratively you simply stop moving and stand very still.
If the DM allows it as a houserule, then the could probably allow you to block one attack and then leave yourself open for the next one, Though they might also rule that once you leave yourself open that you are vulnerable to any other attacks as well. Since this is not specified in the rules it will be up to them entirely as to how to manage it.