Change this:
Account.Name = ':accName'
to this:
Name = :accName
so your entire query would be:
Account accountId = [
SELECT Id, Name FROM
Account whereWHERE Name = :accName AND Account_External_Id__c != null
LIMIT 1
];
saying = ':accName'
is looking for Accounts with the literal value ":accName" since you wrapped it in single quotes. You don't need single quotes around SOQL bind variables.
You should not have this SOQL query within your for loop - please see Apex best practices. For every iteration of your loop, you will accrue a SOQL query - this will quickly hit governor limits in any type of bulk scenario.