UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yW/nszZmLwHdRhGPwB6pJSDfuvh/LgH0/o4Zdp1/WD8='
WHERE
key_id = '550ee119909ab9a464f1db7c263ca6e65e45ae9251c7a06890736e42feb37824'
AND (
token = 'yW/nszZmLwHdRhGPwB6pJSDfuvh/LgH0/o4Zdp1/WD8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)