UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'egG+eURckEAS85yeLi+FoeP/3djI1Z5OpBtMVqFbf+0='
WHERE
key_id = 'aa86fd253087718498f59c9a96313fce96c89fb576f010ade9ea44f5acc22796'
AND (
token = 'egG+eURckEAS85yeLi+FoeP/3djI1Z5OpBtMVqFbf+0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)