update <@TABLENAME@> 
set value = '<@COLVALUE@>' where 
store_id = <@STORE_ID@> 
and entity_type_id = 
(  SELECT b.entity_type_id from eav_entity_type b
where 
'<@COLVALUE@>' <> '' and 
entity_id =  <@KEY@>
and b.entity_table = '<@ATTRIBTYPE@>')
and 
attribute_id = (
SELECT c.attribute_id from eav_entity_type b
JOIN eav_attribute c ON c.entity_type_id = b.entity_type_id
WHERE b.entity_table = '<@ATTRIBTYPE@>' and c.attribute_code = '<@ATTRIBNAME@>'
)
