I don't think GDPR would prevent this I read though it for work before it was implemented I don't recall anything saying algorithms can't make decisions about people. Our company uses algorithms to decide what ad is displayed to people, and I'm not recalling anything that would make these diffrent under the law.
Furthermore, I believe the government has been given broad exceptions from GDPR for anything related to doing government stuff. This is form of legitimate interest "processing is necessary for the performance of a task carried out in the public interest or in the exercise of official authority vested in the controller;" It is in the public interest the border control laws be enforced and a manner that is both effective and minimized cost to the public, also this involves the exercise of official border control authority, therefore this is acceptable.
(Standard reminder that if you are relying on the advice of a stranger for legal issues that matter you should get an attorney.)
It is interesting that there is a comment about explicit consent - I imagine this will be like the millimeter wave scanners: you can either go in and get your genitals imaged by some remote voyeur, or if you dont like that then you can get a thorough strip search by someone in blue gloves. Have a nice day :-)
Furthermore, I believe the government has been given broad exceptions from GDPR for anything related to doing government stuff. This is form of legitimate interest "processing is necessary for the performance of a task carried out in the public interest or in the exercise of official authority vested in the controller;" It is in the public interest the border control laws be enforced and a manner that is both effective and minimized cost to the public, also this involves the exercise of official border control authority, therefore this is acceptable.
(Standard reminder that if you are relying on the advice of a stranger for legal issues that matter you should get an attorney.)