Syntaxt error

Ive been trying to write a bit of dialplan that acts based on the value of recordings for the given extension in the astDB.

The error is for the last line (IN,1). Funny thing is that asterisk doesnt report any error for the first line (OUT,1)

this is the error:

[Apr 15 16:58:32] WARNING[14759] ast_expr2.fl: ast_yyerror(): syntax error: syntax error, unexpected '=', expecting $end; Input:
= Always

this is the dialplan:

exten => OUT,1,Gotoif($[$["${DB(AMPUSER/${ARG1}/recording)}" : "out=([^|]+)"] = Always]?r,1)
exten => GROUP,1,Gotoif($[$["${DB(AMPUSER/${ARG1}/recording)}" : "out=([^|]+)"] = Always]?r,1)
exten => IN,1,Gotoif($[$["${DB(AMPUSER/${ARG1}/recording)}" : "in=([^|]+)"] Always]?r,1)