@Václav Ornst, Welcome to Microsoft Q&A, according to the doc, we need to use an object array as the second parameter of Query method.
You could try the following code to solve your problem:
Accounts? account = db.Query<Accounts>($"SELECT * FROM {nameof(Accounts)} WHERE LOWER({nameof(Accounts.Email)}) = LOWER(@Email) AND {nameof(Accounts.AccountId)} = @AccountId", new object[] { email,accountId}
).FirstOrDefault<Accounts>();
Based on my test, it could get the correct result.
Best Regards,
Jack
If the answer is helpful, please click "Accept Answer" and upvote it. Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.