UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ASQOlCIrgx/xYJKX9T6nOJu8BB8oZ75U20Ma6JuztlY='
WHERE
key_id = 'b9cee732373bd7cfb28120135fc4c815e747694ade6348d9ec65ed055546ba5b'
AND (
token = 'ASQOlCIrgx/xYJKX9T6nOJu8BB8oZ75U20Ma6JuztlY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)