If an area is defined as 'an enclosed public space', it's illegal for anyone to smoke there, at any time. Even the landlord isn't allowed to smoke in the public areas of his pub, irrespective of whether the pub is open to the public or not.
With regard to the 'lock in' element of the question, CheekyChops is not necessarily correct. Many pubs have 'permitted hours' which are longer than their normal trading hours. There's nothing to stop them continuing to serve customers who're already present, while excluding latecomers, as long as they remain within the permitted hours. Indeed, I know of one pub (the Dove Street Inn in Ipswich) which is actually required, under the terms of its licence, to lock the doors and close the blinds at a certain time (to stop new customers from entering), well before its actual closing time.
Chris