Given your interests and very limited time, I’d spend the evening of day 1 in Valletta, morning of day 2 in Valletta (visit St John’s co-cathedral, get an audio guide. It is more interesting than any museum), then visit Mdina, explore its streets, have lunch on the city walls and return to Valletta in the evening. Leave Gozo for your next trip, when you have more time.