UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QQ4t/szqSA++sZ8B0iccZAY/90g/fOkUZq437yxY1kc='
WHERE
key_id = '39ec62e0a692619644309eb8bf681bfbd32e2a2ed022648e1398f61904454afd'
AND (
token = 'QQ4t/szqSA++sZ8B0iccZAY/90g/fOkUZq437yxY1kc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)