There is a procedure in which the lock is overridden in case of no-response from the cockpit; it's time based so it might take somewhere between 45 seconds to 5 minutes to get the door open.
If the inhabitant of the cockpit chooses to respond with a locking command (in the case of the A320, moving the door switch forward); the door will remain closed no matter how hard you try.