The operative verb here is κλείω, κεκλεισμένων in this case, Perfect Participle Middle or Passive - Genitive Feminine Plural.
This is tricky so stay with me here. The cognate relative of the word is κλείς (kleis) which is simply "key" used for locking a door.
However, the verb κλείω occurs 16 times in the NT and means, according to BDB:
to prevent passage at an opening, shut, lock, bar
This word is translated as either "shut" or "lock" in various places such as:
- clearly "shut": Matt 6:6, Luke 4:25, 11:7, 1 John 3:17, etc
- clearly "lock": Acts 5:23.
Some of the occurrences are debatable and John 20:19 is certainly debatable. That is, it could be translated, quite validly, as either "shut" or "locked", or even (more likely) "barred", that is, closed and a beam or wood placed across the door and most humble homes could not afford the expense of a lock.
Therefore, my preference in this case is "barred" because the disciples were frightened "for fear of the Jews". The context suggests that Jesus simply "appeared" among them miraculously because no door is described as being opened. Ellicott observes here:
When the doors were shut where the disciples were assembled . . .—This
fact is noted here and in John 20:26, and the obvious intention is to
point out that the appearance was preternatural. The body of the risen
Lord was indeed the body of His human life, but it was not subject to
the ordinary conditions of human life. The power that had upheld it as
He walked upon the Sea of Galilee (John 6:16-21) made it during those
forty days independent of laws of gravitation and of material
resistance. (Comp. Notes on Luke 24:15-16; Luke 24:31; Luke 24:39.)
The supposition that the doors were shut, and were miraculously opened
(comp. Acts 12:10), is opposed to the general impression of the
context, and the incident is one which would probably have been
mentioned.