The CASMailbox object does not have the OU or CustomAttribute properties, but the Mailbox object does have protocolsettings property collection, so:
$OU='OU=SomeOU,DC=Domain,DC=com'
$ext14='00254'
Get-Mailbox -OrganizationalUnit $OU|
Where {($_.CustomAttribute14 -eq $ext14) -and ($_.protocolsettings -match 'OWA.1'} |
Set-CASMailbox -OWAEnabled:$false