Set boolean field to true if query match otherwise set to false
Yes, one update is sufficient:

UPDATE spaceShips
    SET hasArtificialIntelligence = spaceShips.id in ( ...,someIds,... )
WHERE shipType='warship'


spaceShips.id in ( ...,someIds,... ) will evaluate to either true or false (assuming someid is not null)